package net.homelinux.chaoswg.io.renga.core.registries;

import java.util.HashMap;
import java.util.Map;

import net.homelinux.chaoswg.io.renga.core.gui.operations.Operation;

import org.jdom.Element;

public class ConnectionRegistry {
    private static Map<Operation, Element> _mapping = null;
    private static ConnectionRegistry _this = null;
    
    private ConnectionRegistry () {
        _mapping = new HashMap<Operation, Element>();
    }
    
    public static ConnectionRegistry getConnectoRegistry () {
        if (_this == null) {
            _this = new ConnectionRegistry ();
        }
        return _this;
    }
    
    public void setElement (final Operation op, final Element e) {
        _mapping.put(op, e);
    }
    
    public Element getElement (final Operation op) {
        return _mapping.get(op);
    }
    
    public void clearRegistry () {
        _mapping.clear();
    }
    
}
